package com.boss.salary.enums;

/**
 * <br>Title: 工资类别枚举类
 * <br>Description: 工资类别枚举类
 * <br>Author: 王再岐
 * <br>Date: 2020-11-19 11：30
 */
public enum SalaryTypeEnum {
    /** 行政人员 **/
    ADMINISTRATOR_PERSON("0", "行政人员"),
    /** 事业人员 **/
    CAUSE_PERSON("1", "事业人员"),
    /** 离休人员 **/
    QUIT_PERSON("11", "离休人员");

    private String code;
    private String name;

    SalaryTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static SalaryTypeEnum valueOfCode(String code) {
        SalaryTypeEnum[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            SalaryTypeEnum typeEnum = var1[var3];
            if (typeEnum.getCode().equals(code)) {
                return typeEnum;
            }
        }
        return null;
    }

    public static String valueOfName(String name) {
        SalaryTypeEnum[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            SalaryTypeEnum typeEnum = var1[var3];
            if (typeEnum.getName().equals(name)) {
                return typeEnum.code;
            }
        }
        return null;
    }


    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }
}
